package com.qxzn.app.medicalhealth.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.qxzn.app.medicalhealth.bean.FamilyPageBean;

import java.util.ArrayList;
import java.util.List;

public class FamilyCasesAdapter extends FragmentPagerAdapter {

    private List<FamilyPageBean> pageList = new ArrayList<>();

    public FamilyCasesAdapter(FragmentManager fm, List<FamilyPageBean> pageList) {
        super(fm);
        this.pageList = pageList;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return pageList.get(position).getTitle();
    }

    @Override
    public Fragment getItem(int position) {
        return pageList.get(position).getFragment();
    }

    @Override
    public int getCount() {
        return pageList.size();
    }
}
